<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Insert title here</title>
    <link rel="stylesheet"
          href="https://cdn.bootcss.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/popper.js/1.12.5/umd/popper.min.js"></script>
    <script
            src="https://cdn.bootcss.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
    <style>
        .imgs {
            width: 900px;
            height: 400px;
            background-position: center;
            background-size: cover;
        }
        body {
            background-image: url("<%=request.getContextPath()%>/img/background2.jpg");
            background-repeat: no-repeat; /*设置背景不重复*/
            background-attachment: fixed; /*背景图片不会随着页面的滚动而滚动。*/
            background-size: cover; /*	此时会保持图像的纵横比并将图像缩放成将完全覆盖背景定位区域的最小大小。*/
            /*opacity: 0.5设置透明度*/
        }
    </style>
    <script type="text/javascript">
        function doDelete(userid) {
            /* 如果这里弹出的对话框，用户点击的是确定，就马上去请求Servlet。
            如何知道用户点击的是确定。
            如何在js的方法中请求servlet。 */
            var flag = confirm("是否确定删除?");
            if (flag) {
                //表明点了确定。 访问servlet。 在当前标签页上打开 超链接，
                //window.location.href="DeleteServlet?sid="+sid;
                location.href = "DeleteServlet?Userid=" + userid;
            }
        }
    </script>
</head>
<%--<body background="<%=request.getContextPath() %>/img/background1.jpg">--%>
<body>
<h2 align="center" style="margin-top: 20px;">网吧管理系统</h2>
<div>
    <div class="row " style="margin-top: 50px;">
        <div align="center" class="col-md-3">
            <ul class="list-group">
                <li class="list-group-item "><a href="<%=request.getContextPath() %>/Super/User_about.jsp"><span
                        style="color: black">首页</span></a></li>
                <li class="list-group-item active "><a href="<%=request.getContextPath() %>/UserInfoServlet?userid=${sessionScope.userid}"><span
                        style="color: black">个人信息</span></a></li>
                <li class="list-group-item  "><a href="<%=request.getContextPath() %>/UserXiaofeiListServlet?userid=${sessionScope.userid}"><span
                        style="color: black">消费清单</span></a></li>
                <li class="list-group-item  "><a href="<%=request.getContextPath() %>/Super/User_exit.jsp"><span
                        style="color: black">退出</span></a></li>
            </ul>
        </div>
        <div class="col-md-9">
            <table class="table table-bordered">
                <tr style="text-align: center;" >
                    <td>用户id</td>
                    <td>用户名</td>
                    <td>密码</td>
                    <td>生日</td>
                    <td>性别</td>
                    <td>用户类型</td>
                    <td>总充值金额</td>
                    <td>已消费金额</td>
                    <td>未消费金额</td>
                    <td>会员等级</td>
                    <td>手机号</td>
                    <td>入会日期</td>
                    <td style="width:100px;">操作</td>
                </tr>

<%--                <c:forEach items="${pageBean.list }" var="users">--%>
                    <tr align="center">
                        <td>${user.userid }</td>
                        <td>${user.username }</td>
                        <td>${user.passwords }</td>
                        <td>${user.birthday }</td>
                        <td>${user.sex }</td>
                        <td>
                            <c:if test="${user.usertype == 1}">会员</c:if>
                            <c:if test="${user.usertype == -1}">系统管理员</c:if>
                        </td>
                        <td>${user.money }</td>
                        <td>${user.yxf }</td>
                        <td>${user.wxf }</td>
                        <td>${user.dengji }</td>
                        <td>${user.phone }</td>
                        <td>${user.rhtime }</td>
                        <td>
                            <a href="EditUserInfoServlet?userid=${user.userid }">更新</a>
                            <a href="UserDetailServlet?userid=${user.userid}&usertype=${user.usertype}">充值</a>
                        </td>
                    </tr>
            </table>

<%--            <nav class="text-center">--%>
<%--                <ul class="pagination">--%>
<%--                    <!-- 上一页 -->--%>
<%--                    <li class="page-item"><a href="UserListServlet?currentPage=${pageBean.currentPage-1 }"--%>
<%--                                             class="page-link"--%>
<%--                                             aria-label="Previous"> <span aria-hidden="true">&laquo;</span>--%>
<%--                    </a></li>--%>
<%--                    <!-- 页码 -->--%>
<%--                    <!-- 下一页 -->--%>
<%--                    <li class="page-item"><a href="UserListServlet?currentPage=${pageBean.currentPage+1 }"--%>
<%--                                             class="page-link"--%>
<%--                                             aria-label="Next"> <span aria-hidden="true">&raquo;</span>--%>
<%--                    </a></li>--%>
<%--                </ul>--%>
<%--            </nav>--%>
<%--            <a href="Super/Super_AddUser.jsp" class="btn btn-default"><span>添加单个用户</span></a>--%>
        </div>
    </div>
</div>
<%--<jsp:include page="Super_footer.jsp"></jsp:include>--%>
</body>
</html>